<?php
session_start();

$user = $_SESSION["user"];

$Title = $_POST["title"];
$Content = $_POST["content"];
$id = $_GET["id"];
$Updattime = date_format(new DateTime(),'Y-m-d H:i:s'); 

$sql = "update `article` set `title`='$Title',content='$Content', updatetime='$Updattime' where Id=$id and Id=" .$user["id"];
$conn = new mysqli('localhost','root','root','mydb');
    $conn->query($sql);
    if ($conn->connect_error) 
    die("连接失败: " . $conn->connect_error);
    echo "修改成功";

    $URL = "article_list.php";
    if(isset($URL)){
        header("Location: $URL");
        exit;
    }
?>